<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
        <title>学习资料管理</title>
        <include file='Layout:ins_css' />
        <style type="text/css">
            #addBtn {
                float: right;
                margin: -7px -6px 9px;
            }
        </style>
    </head>
    <body>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>学习资料管理</h5>
                            <button class="btn btn-primary" id="addBtn">新增</button>
                        </div>
                        <div class="row s-row">
                            <div class="col-sm-12">
                                <div class="price-div">
                                    <form class="form-horizontal">
                                        <div class="form-group cyf-form-group">
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left" class="col-sm-4 control-label cvbnm">教学方案:</label>
                                                <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="teach_method_info" id="vo">
                                                        <option value="{$vo.id}">{$vo.me_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left" class="col-sm-4 control-label cvbnm">章:</label>
                                                <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="teach_method_info" id="vo">
                                                        <option value="{$vo.id}">{$vo.me_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                            <div class="col-sm-4" style="margin-top: 10px; margin-bottom: 10px">
                                                <label style="float: left" class="col-sm-4 control-label cvbnm">节:</label>
                                                <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                    <option value="0">全部</option>
                                                    <volist name="teach_method_info" id="vo">
                                                        <option value="{$vo.id}">{$vo.me_name}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <table class="table table-striped table-bordered table-hover dataTables-example" id="RuleTable">
                                <thead>
                                    <tr>
                                        <th  width="16%">资料编号</th>
                                        <th  width="16%">资料名称</th>
                                        <th  width="16%">所属节</th>
                                        <th  width="16%">节内序号</th>
                                        <th  width="16%">资料</th>
                                        <th  width="20%">操作</th>
                                    </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Modal 添加资料信息-->
        <div class="modal fade" id="AdVedioModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">新增资料</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" id="form_add">
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">教学方案:</label>
                                <select class="form-control poiu" id="select_tme" name="select_tme">
                                    <option value="0">请选择</option>
                                    <volist name="tea_sel_add" id="vo">
                                        <option value="{$vo.tea_id}">{$vo.tea_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">章:</label>
                                <select class="form-control poiu" id="select_chapter" name="select_chapter">
                                    <option value="0">请选择</option>
                                    <volist name="tea_sel_add" id="vo">
                                        <option value="{$vo.tea_id}">{$vo.tea_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label cvbnm nationality">节:</label>
                                <select class="form-control poiu" id="select_section" name="select_section">
                                    <option value="0">请选择</option>
                                    <volist name="tea_sel_add" id="vo">
                                        <option value="{$vo.tea_id}">{$vo.tea_name}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">资料编号</label>
                                <div class="col-sm-7">
                                    <input type="text" readonly="readonly" id="" name="" class="form-control removeData">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">资料名称</label>
                                <div class="col-sm-7">
                                    <input type="text" id="add_sch_name" name="add_sch_name" class="form-control removeData">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">资料长度</label>
                                <div class="col-sm-7">
                                    <input type="text" id="add_sch_office" name="add_sch_office" class="form-control removeData">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">资料文件</label>
                                <div class="col-sm-7">
                                    <input class="file form-control" name="upload_file" id="upload_file" type="file" data-show-caption="true" multiple />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="add_btn">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <include file='Layout:ins_js' />
        <script type="text/javascript" src="__VENDOR__/fileinput/fileinput.min.js"></script>
        <script type="text/javascript" src="__VENDOR__/fileinput/locales/zh.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                //自检
                check_index();
            });
            // 上传
            $("#upload_file").fileinput({
                language: 'zh', //设置语言
                uploadUrl: "__URL__/UploadExcel", //上传的地址
                allowedFileExtensions: ['xls','xlsx'], //接收的文件后缀
                autoReplace: true,
                browseLabel: '上传文件',
                uploadAsync: false, //默认异步上传
                showUpload: false, //是否显示上传按钮
                showRemove: false, //显示移除按钮
                showPreview: false, //是否显示预览
                showCaption: false, //是否显示标题
                browseClass: "btn btn-primary", //按钮样式
                dropZoneEnabled: true, //是否显示拖拽区域
                maxFileSize: 0, //单位为kb，如果为0表示不限制文件大小
                maxFileCount: 1, //表示允许同时上传的最大文件个数
                enctype: 'multipart/form-data',
                previewClass: 'previewPanel',
                //initialPreview: [
                //"<img src='__ROOT__/Uploads/Upload_brands/" + urlImg + " ' class='file-preview-image' />",
                //],
                previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",

            });
            //初始化select2
            $("#select_tme").select2({
                width: '300px',
                dropdownParent: $("#AdVedioModal")
            });
            $("#select_chapter").select2({
                width: '300px',
                dropdownParent: $("#AdVedioModal")
            });
            $("#select_section").select2({
                width: '300px',
                dropdownParent: $("#AdVedioModal")
            });
            //新增
            $('#addBtn').on('click', function() {
                $('.wrapper').removeClass('animated');
                $('#AdVedioModal').modal();
            });
        </script>
    </body>
</html>